package api

import (
	apiV1 "gino/app/controller/api/v1"
	"gino/app/middleware"
	"github.com/gin-gonic/gin"
)

// RegisterAPIV1 ...
func RegisterAPIV1(apiGroup *gin.RouterGroup) {

	apiGroup.POST("/login", apiV1.User.Login)       // 登录
	apiGroup.POST("/register", apiV1.User.Register) // 注册

	// 用户
	apiUserGroup := apiGroup.Group("/user")
	registerUserAPIV1(apiUserGroup)

}

func registerUserAPIV1(apiUserGroup *gin.RouterGroup) {
	apiUserGroup.Use(middleware.JWTAuth())
	apiUserGroup.GET("/list", apiV1.User.List) // 用户-列表
}
